AddPrefabPostInit(
    "razor",
    function(inst)

        -- inst:AddTag("razor")
        
        if inst.SoundEmitter == nil then
            inst.entity:AddSoundEmitter()
        end
        inst.talk_sound = "hookline_2/characters/hermit/talk"

        ---------------------------------------------------------------------------------------------
        -- talker 组件   net_bool 帮助处理偏移
        -- local TALLER_TALKER_OFFSET = Vector3(0, -700, 0)
        local colours = {
            Vector3( 255 /255, 193 /255 , 37 /255),     -- Goldenrod1 橙黄色
            Vector3( 127 /255, 255 /255 , 0 /255),      --- Chartreuse 青绿色
            Vector3( 255 /255, 255 /255 , 0 /255),      --- yellow 黄色
            Vector3( 255 /255, 69 /255 , 0 /255),       -- OrangeRed 橘红色
            Vector3( 0 /255, 191 /255 , 255 /255),      -- DeepSkyBlue 天蓝色
            Vector3( 34 /255, 139 /255 , 34 /255),      -- ForestGreen 深绿色
            Vector3( 238 /255, 233 /255 , 233 /255),     -- Snow2  雪白色
        }
        -- local DEFAULT_TALKER_OFFSET = Vector3(0, -400, 0)
        inst:AddComponent("talker")
        inst.components.talker.offset = DEFAULT_TALKER_OFFSET
        inst.components.talker.fontsize = 35  --- defualt = 28
        inst.components.talker.font = TALKINGFONT
        inst.components.talker.color_num = 1
        inst.components.talker.colour = colours[inst.components.talker.color_num]
        inst.components.talker.offset = Vector3(0, -200, 0)
        inst.components.talker.Say_old_batbat = inst.components.talker.Say
        inst.components.talker.Say = function(self,...)
            self:Say_old_batbat(...)
            self.color_num = math.random(#colours)
            -- self.color_num = self.color_num + 1
            -- if self.color_num > #colours then
            --     self.color_num = 1
            -- end
            self.colour = colours[self.color_num]
        end
        ---------------------------------------------------------------------------------------------

        if not TheWorld.ismastersim then
            return
        end

        inst:AddComponent("npc_base_lib")
        inst.npc_base_lib = inst.components.npc_base_lib

        -- if inst.components.tradable == nil then
        --     inst:AddComponent("tradable")
        -- end
        --- 给NPC上 alltrader  tag 就行，用tradable组件可能会和其他MOD冲突
    end
)